duct.rs
A cross-platform library for running child processes and building pipelines.
duct
wants to make shelling out in Rust as easy and flexible as it is in
Bash. It takes care of gotchas and
inconsistencies
in the way different platforms shell out. And it's a cross-language library;
the original implementation is in
Python, with an identical API.
Changelog
- Version 0.9 removed the
sh
function. It now lives in its own crate,duct_sh
.
Example
duct
tries to be as concise as possible, so that you don't wish you were
back writing shell scripts. At the same time, it's explicit about what
happens to output, and strict about error codes in child processes.
extern crate duct;
use cmd;
duct
uses os_pipe
internally, and the docs for that one include a big
example that takes a dozen lines of code
to read both stdout and stderr from a child process. duct
can do that in
one (moderately long) line:
let output = cmd!.stderr_to_stdout.read.unwrap;
assert!;